package com.mzkj.wanjulaile.mobile.api.modules.session.service;

import com.mzkj.wanjulaile.mobile.api.common.entity.ResultEntity;
import com.mzkj.wanjulaile.mobile.api.modules.session.entity.Session;

/**
 * session会话 Service类
 * Created by wangxw on 2016/12/13.
 */
public interface SessionService {

    Session insert(Session session);

    Session findByAccessToken(String accessToken);

    //没有校验accessToken值，其他地方不要引用
    Session findByAccessToken2(String accessToken);

    Session findByRefreshToken(String refreshToken);

    Session updateByAccessToken(Session session);

    Session updateByRefreshToken(Session session);

    void delete(Long id);

    int delete(String accountId);

    ResultEntity validAccessToken(String accessToken);

    ResultEntity<Session> refreshToken(String refreshToken);

    ResultEntity<Session> validateToken(String accessToken, String refreshToken);
}
